package main

import (
	"fmt"
	"reflect"
)

//使用DeepEqual()方法

// 创建一个结构
type Author struct {
	name      string
	branch    string
	language  string
	Particles int
}

func main() {

	//定义变量
	//作者结构
	a1 := Author{
		name:      "Soana",
		branch:    "CSE",
		language:  "Perl",
		Particles: 48,
	}

	a2 := Author{
		name:      "Soana",
		branch:    "CSE",
		language:  "Perl",
		Particles: 48,
	}

	a3 := Author{
		name:      "Dia",
		branch:    "CSE",
		language:  "Perl",
		Particles: 48,
	}

	//比较a1和a2,使用Deep Equal()方法
	fmt.Println("a1等于a2吗: ", a1 == a2)
	fmt.Println("a1等于a2吗: ", reflect.DeepEqual(a1, a2))

	//比较a2和a3,使用Deep Equal()方法
	fmt.Println("a1等于a2吗: ", a2 == a3)
	fmt.Println("a2等于a3吗: ", reflect.DeepEqual(a2, a3))
}
